How can I swap two variables without using a third variable?
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Amit Singh
07-May-2011we can swap using only two variable for example
int a=5,b=10;a=a+b; b=a-b; a=a-b;
check it.